package com.sskj.mine.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.bean.AppVersionBean;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.ui.activity.MineAboutActivity;


public class MineAboutActivityPresenter extends BasePresenter<MineAboutActivity> {
    public void getNewVersion() {
        httpService.getVersion()
                .execute(new JsonCallBack<HttpData<AppVersionBean>>(true) {
                    @Override
                    public void onSuccess(Response<HttpData<AppVersionBean>> response) {
                        HttpData<AppVersionBean> httpData = response.body();
                        ToastUtil.showShort(httpData.getMsg());
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.onVersionDataSuccess(httpData.getData());
                        }
                    }
                });
    }
}
